package smlab.view.state
{
	import flash.display.Sprite;
	
	import smlab.interfaces.IContainer_SM;

	/**
	 * 容器“基类”
	 * @author simon
	 * 
	 */
	public class Container_SM extends Sprite implements IContainer_SM
	{
		protected var _initialized:Boolean=false;
		protected var _stateName:String='';
		protected var _isStart:Boolean=false;
		
		public function Container_SM()
		{
		}
		
		/**
		 * 场景自身初始化过程（加载皮肤和配置文件等），此方法全部完成后设置 initialized
		 * 然后执行 start
		 * 
		 */
		public function initialize():void{
		}

		/**
		 * 场景开始运行、添加监听等
		 * 
		 */
		public function start():void{
			isStart=true;
		}
		
		/**
		 * 场景休眠（或被移除）、移除监听等
		 * 
		 */
		public function sleep():void{
			isStart=false;
		}
		
		/**
		 * 设置场景是否已经初始化完毕
		 * @param b
		 * 
		 */
		public function set initialized(b:Boolean):void{
			this._initialized=b;
		}
		
		public function get initialized():Boolean{
			return this._initialized;
		}
		
		public function set stateName(b:String):void{
			this._stateName=b;
		}
		
		public function get stateName():String{
			return this._stateName;
		}
		
		public function set isStart(b:Boolean):void{
			this._isStart=b;
		}
		
		public function get isStart():Boolean{
			return this._isStart;
		}
		
	}
}